import React from 'react'
import {
  BrowserRouter as Router,
  Route,
  Switch,
  Redirect,
} from 'react-router-dom'

import '@/App.scss'

const Login = React.lazy(() => import('@/pages/Login'))
const Home = React.lazy(() => import('@/pages/Home'))
export default function App() {
  return (
    <React.Suspense fallback={<div>loding...</div>}>
      <Router>
        <div className="app"></div>
        <Switch>
          <Redirect exact from="/" to="/home" />
          <Route path="/home" component={Home}></Route>
          <Route path="/login" component={Login}></Route>
        </Switch>
      </Router>
    </React.Suspense>
  )
}
